﻿// ===============================================================================
// DotNet.Platform 开发框架 2016 版权所有
// ===============================================================================

using DotNet.Edu.Service;
using System.Web.Mvc;
using DotNet.Extensions;

namespace DotNet.EduWeb.Areas.Edu.Controllers
{
    public class AqpxPayOrderController : EduController
    {
        public ActionResult Index()
        {
            return View();
        }

        public ActionResult Grid(string name, string trade_no, string trade_state,string order_type, string start_date, string end_date)
        {
            if(trade_state.IsEmpty()){
                trade_state = "SUCCESS";
            }
            var list = EduService.AqpxPayOrder.GetPageList(PageInfo(), name, trade_no, trade_state, order_type, start_date, end_date);
            return View(list);
        }

        public ActionResult Details(string id)
        {
            var entity = EduService.AqpxPayOrder.Get(id);
            if (entity == null) return NotFound(id);
            return View(entity);
        }

        public ActionResult Export()
        {
            return Export(EduService.AqpxPayOrder.GetList());
        }

        private ActionResult NotFound(string id)
        {
            return NotFound("获取 安全两类人培训费支付订单信息 错误", $"无法找到 主键 = {id} 的安全两类人培训费支付订单信息");
        }
    }
}
